#ifndef LINKED_LIST_H
#define LINKED_LIST_H

#include <stdbool.h>


struct list;

typedef void* list_data_t;

struct list * list_init();
/* On failure: Returns NULL*/

void list_destroy(struct list * l);

int list_push_back(struct list * l, list_data_t data);
/*
  Adds a unit to the end of the list.
  On success: returns 0.
*/

int list_pop_front(struct list * l, list_data_t* out_data);
/*
	Removes the first unit and put it's data in *out_data (if out_data is not
	NULL).
	On success: returns 0.
	If the list is empty returns -1.
*/

int list_get_front(struct list * l, list_data_t* out_data);
/*
	Puts the 'front' unit's data in *out_data.
	On success: returns 0.
*/

int list_remove_first_occurrence(struct list * l, list_data_t data);
/*
	Removed the first unit that holds 'data'.
	If a unit was removed: returns 0.
*/

bool list_is_empty(struct list * l);



void list_debug_print(struct list * l);


#endif /* LINKED_LIST_H */
